<?php
namespace FactoryPattern\Shape;

class ShapeFactory {
    
    public function getShape($shapeType) {
        
        if (null == $shapeType) {
            return null;
        } elseif ('circle' == $shapeType) {
            return new CircleImpl();
        } elseif ('rectangle' == $shapeType) {
            return new RectangleImpl();
        } elseif ('square' == $shapeType) {
            return new SquareImpl();
        }
        return null;
        
    }

}

